DLL'ed by Charlie McIver - Purple Computer Solutions
This DLL is "hamware" - I don't make any charge or restriction on the use of
it, provided it is within the scope of of Amateur Radio. ANY other use must
obtain permission first (which probably will cost).
This is simply a DLL version of Axel's 7+ software. 7+ is very popular, but for
authors who use Visual Basic the 'C' source isn't much use when trying to add
automatic 7+ facilities. Turning it into a DLL allows (not just VB users)
access to 7+ encoding / decoding without having to fully understand it.
Here are the function prototypes in 'C' :-
int FAR PASCAL _export seven_plus_join(LPSTR file1, LPSTR file2)
int FAR PASCAL _export seven_plus_encode(LPSTR filename, long Blocksize, int first_part, int last_part, int fls, int binary);
int FAR PASCAL _export seven_plus_process(LPSTR filename, int cleanup, int override);
int FAR PASCAL _export seven_plus_extract(LPSTR filename);
int FAR PASCAL _export seven_plus_version();
int FAR PASCAL _export Seven_Plus_Do(LPSTR lpstrCommands, int nStrLen);
Here are the VB declarations :-
Declare Function seven_plus_encode Lib "7plus.dll" (ByVal filename As String, ByVal blocksize As Long, ByVal first_part As Integer, ByVal last_part As Integer, ByVal info As Integer, ByVal crmode As Integer) As Integer
Declare Function seven_plus_process Lib "7plus.dll" (ByVal filename As String, ByVal Path As String, ByVal cleanup As Integer, ByVal override As Integer) As Integer
Declare Function seven_plus_version Lib "7plus.dll" () As Integer
Declare Function seven_plus_extract Lib "7plus.dll" (ByVal filename As String) As Integer
Declare Function seven_plus_join Lib "7plus.dll" (ByVal file1 As String, ByVal file2 As String) As Integer
Declare Function Seven_Plus_Do Lib "7plus.dll" (ByVal Commands As String, ByVal StrLen) As Integer
encode blocksize (bytes) - length of encoded file (0 defaults to around 10K)
first_part (0) - Reserved for future use
last_part (0) - Reserved for future use
fls (0/1) - Generate FLS file
binary (0/1) - Use 'Binary' mode (affects CR and LF)
process cleanup (0/1) - Remove all obselete files after decode
override (0/1) - Reserved for future use
The return values are the same as the original 7plus code :-
0 No errors detected.
1 Write error.
2 File not found.
3 7PLUS header not found.
4 File does not contain expected part.
5 7PLUS header corrrupted.
6 No filename for extracting defined.
7 invalid error report / correction / index file.
8 Max number of parts exceeded.
9 Bit 8 stripped.
10 User break in test_file();
11 Error report generated.
12 Only one or no error report to join
13 Error report/cor-file does not relate to the same original file
14 Couldn't write 7plus.fls
15 Filesize of original file and the size reported in err/cor-file not equal
16 Correction not successful.
17 No CRC found in err/cor-file.
18 Timestamp in metafile differs from that in the correction file.
19 Metafile already exists.
These are as documented by Axel, I spotted one error. 12 can also mean
out of memory.
Generally you should use the seven_plus_process function to decode files, and
seven_plus_encode to encode files. You can use seven_plus_process to encode
files using all the defaults. I suggest that in your implementation of 7plus
into your program you should have a directory where all 7+ files are put.
Before any 7plus operation you should change into this directory, perform the
funtion and, if necessary, change back out. This is particulary important when
processing a .COR file, where the original .7PL or .Pxx files are needed.
Another problem is presented when processing a .ERR file, the original uncoded
file must still be available.
Functions to cover extract and join are also provided. To join multiple error
files you should leave the second filename paramer blank. I'm unsure of how
effective their implementation is. I'm not much of a 7+ user myself. If you
have ideas of a better way to do all this tell me!
Included withing the zip is a VB program call WIN7PLUS, which is a simple
version of 7+ for Windows. Study this and how it works.
I have started a list of people developing software using this DLL. If you
wish to be added to this then simply ask. This way I can tell people when I
update it.
This was a very simple and basic conversion, additions are possible, just ask!
The only known bug relates to the release of a file handle somewhere in the 7+
code. I have passed this to Axel.
2.17 brings the Seven_Plus_Do call. One string is passed in, and the length
of it. The string should be zero terminated. See the example for more details.
The DLL proecesses this exactly as 7+ does as a DOS program.